<?
layout("/inc/layout.html",{title:sysTitle}){
?>
<div id="page-wrapper">
	<!--BEGIN TITLE & BREADCRUMB PAGE-->
	<div id="title-breadcrumb-option-demo" class="page-title-breadcrumb">
		<div class="page-header pull-left">
			<div class="page-title">自然语言处理</div>
		</div>
		<ol class="breadcrumb page-breadcrumb pull-left">
			<li><i class="fa fa-home"></i>&nbsp;<a href="main.html">首页</a>&nbsp;&nbsp;<i
				class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
			<li>自然语言处理&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
			<li class="active">自动分类</li>
		</ol>
		<div class="clearfix"></div>
	</div>
	<!--END TITLE & BREADCRUMB PAGE-->
	<!--BEGIN CONTENT-->
	<div class="page-content" style="margin-left:50px; margin-right:50px;">
		
		<img src="images/slide2.png" width="70%" height="100px;"/>
		
		<div class="row" style="margin-top: 10px;">
			<!-- <div class="col-lg-12" style="margin-top: 10px;"> -->
				<div class="form-group">
					<div class="col-md-12" style="text-align:center">
						<label for="inputPhone" class="control-label pull-left"><h4>待处理文本:</h4></label>
					</div>
					<div class="col-md-12">
						<textarea id="text" name="text" rows="8" class="form-control">本实Abortion Failures用新型公开了一种智能计算机设备控制Abortion Failures器，包括冷却Abortion Failures装置固定座、温度检测装置、红灯提示装置和显示屏，所述冷却装置固定座固定安装在冷却装置的下方，且冷却装置固定座上设置有固定螺栓，所述冷却装置的左上方安装有第一连接管固定装置，所述散热装置上设置有电源接口，所述散热装置的前方安装有变频调节控制器。本实用新型的有益效果是：温度检测装置随时检测计算机内部的稳定，使得计算机的散热装置可以通过变频调节控制器，计算机在待机状态下或者工作温度不高时，可以停止或者降低散热速度，从而使得散热装置智能化，节约电能，而且可以保持计算机的工作状态。</textarea>
					</div>
				</div>
			<!-- </div> -->
			<div class="col-lg-12" style="margin-top: 10px;">
				<a href="#" onclick="submitForm();" class="btn btn-success pull-left">提交文本<i class="fa fa-rocket"></i></a>
			</div>
		</div>
		
		<div class="row" style="margin-top: 10px;">
			<div class="col-lg-12">
				<div  class="tab-content responsive" style="min-height:300px">
					<!-- 关键词提取 -->
					<div id="dp-6" class="tab-pane fade in active">
						<div class="row">
						
							<div class="col-lg-8" id="buildWordsHtml">
								<h4>结果集：</h4>
								<button type="button" class="btn" style="margin-bottom: 5px; background-color: #EEDFCC; border: 1px solid #EEDFCC;">数据为空！</button>
							</div>
							<div class="col-lg-4" id="buildWordsCategoryHtml">
								<div id="buildWordsCategoryHtml">
									<h4>注释:</h4>
									<button type="button" class="btn" style="margin-bottom: 5px; background-color: #EEDFCC; border: 1px solid #EEDFCC;">分类号（分类名称）</button>
								</div>
								<div>
									<h4>中图法分类:</h4>
									<!-- 上面可加入异步搜索，用时需谨慎以免误伤 -->
									<!-- <div>
										<input type="text" oninput = "searchM()" name="param"/>
									</div>
									<br> -->
									<ul id="tree" class="ztree" style="width:360px;overflow: auto;">
				
									</ul>
								</div>
							</div>
							
						</div>
					</div>
				</div>
			</div>
		</div>
		
		

	</div>
	<!--END CONTENT-->
</div>

<link type="text/css" rel="stylesheet" href="static/dependency.css">

<script type="text/javascript" src="static/d3.min.js"></script>
<script type="text/javascript" src="static/lex.js"></script>
<script type="text/javascript" src="static/dependency.js"></script>

<SCRIPT type="text/javascript">

function submitForm() {
	var text = $("#text").val();
	if($.trim(text).length<1) {
		alert("请输入待处理文本");
		return false;
	}
	submitBuildWords(text);
}

/*提交方法*/
function submitBuildWords(text){
	$.ajax({
		type: "post",
		url: "submitBuildWords.do",
		data: {
			"text": text
		},
		dataType: "json",
		success: function(data) {
			if(data[0].msg=="OK"){
				var buildWordsHtml ='<h4>结果集：</h4>';
				if(data[0].data.length>0){
					for(var i=0;i < data[0].data.length ;i++){
						buildWordsHtml+='<button type="button" class="btn" style="margin-bottom: 5px; background-color: #FFEBCD; border: 1px solid #FFEBCD;">'+data[0].data[i].classify+'</button>&nbsp;&nbsp;';
					}
				}else{
					buildWordsHtml+='<button type="button" class="btn" style="margin-bottom: 5px; background-color: #EEDFCC; border: 1px solid #EEDFCC;">数据为空！</button>';
				}
				$("#buildWordsHtml").html(buildWordsHtml);
			}else{
				alert("请求失败");
			}
		},
		error : function(data) {
			// alert("请求失败");
		}
	});

}
/*-----------------------树形-----------------------------*/
var treeSetting = {
	async: {
		enable: true, url:"./findallDictItemZTreeAsy.do",
		dataType:"json",
		autoParam:["id","dictId","value","level"]
	},
	view: {
	dblClickExpand: true,
	selectedMulti: false,
	expandSpeed: ($.browser.msie && parseInt($.browser.version)<=6)?"":"fast"
	},
	data: {
	  simpleData: {
	    enable:true
	  }
	},
	callback: {
	 /*  beforeExpand: beforeExpand */
	}
};

//默认根结点
var rootNode = "";
//var rootNode = {"id":1, "pid":"root","dictId":"1", "level":"0","name":"中图法分类","value":"","open":false, "isParent":true};

$(document).ready(function(){
	loadOneTree();
	//loadTree();
});


function loadOneTree(){
	$.ajax({
		type: "post",
		url: "loadOneTree.do",
		data: {
			"dictId": 1
		},
		dataType: "json",
		success: function(data) {
			if(data[0].msg=="OK"){
				/* for(var i=0;i<data[0].data.length;i++){
					rootNode+='{"id":"'+data[0].data[i].id+'", "pid":"1","dictId":"'+data[0].data[i].dictId+'", "level":"'+data[0].data[i].level+'","name":"'+data[0].data[i].name+'","value":"'+data[0].data[i].value+'","open":false, "isParent":'+data[0].data[i].isParent+'},'
				} */
				loadTree(data[0].data);
			}else{
				alert("请求失败");
			}
		},
		error : function(data) {
			// alert("请求失败");
		}
	});
}

function loadTree(rootNode){
	var zTreeObj = $.fn.zTree.init($("#tree"), treeSetting, rootNode);
	zTree = $.fn.zTree.getZTreeObj("tree");
	zTree.expandNode(zTree.getNodes()[0], false);//指定某节点折叠
	/* var node = zTreeObj.getNodeByParam("id", 1, null);
	zTreeObj.reAsyncChildNodes(node, "refresh"); */
}
/*用于输入框搜索方法谨慎使用以免误伤*/
/* function searchM() {
  var param = $.trim($("input[name='param']").val());
  var treeObj = $.fn.zTree.getZTreeObj("tree");
  var node = treeObj.getNodeByParam("dictId", 1, null);
  if(param != ""){
    param = encodeURI(encodeURI(param));
    treeObj.setting.async.otherParam=["param", param];
  }else {
    //搜索参数为空时必须将参数数组设为空
    treeObj.setting.async.otherParam=[];
  }
  treeObj.reAsyncChildNodes(node, "refresh");
} */
/* function beforeExpand(){
	alert(111);
} */
/*
function zTreeOnNodeCreated(event, treeId, treeNode) {
	alert(JSON.stringify(treeNode))
   var param = $.trim($("input[name='param']").val());
  var treeObj = $.fn.zTree.getZTreeObj("tree");
  //只有搜索参数不为空且该节点为父节点时才进行异步加载
  if(param != "" && treeNode.isParent){
    treeObj.reAsyncChildNodes(treeNode, "refresh");
  } 
}; */
/*-----------------------树形-----------------------------*/

</SCRIPT>


<?} ?>

